import service from "../../utils/request"

export const getContractsPage = async (page: number, person_phone: string): Promise<PageResult<ListContracts[]>> =>
    await service.get(`/contracts/page?page=${page}&person_phone=${person_phone}`)

export const changeContractsStatus = async (id: string, data: { status: boolean }): Promise<Result<string>> =>
    await service.patch(`/contracts/status/${id}`, data)

export const delContracts = async (id: string): Promise<Result<string>> =>
    await service.delete(`/contracts/${id}`)

export const manyDelContracts = async (ids: string): Promise<Result<string>> =>
    await service.delete(`/contracts/many/${ids}`)